import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:largefriends/res.dart';
import 'package:largefriends/res/lf_color.dart';
import 'package:largefriends/res/lf_double_ext.dart';
import 'package:largefriends/res/lf_fonts.dart';
import 'package:largefriends/res/lf_text_style.dart';

class CommonEmptyPage extends StatelessWidget {
  final String title;
  final String tip;
  final BoxConstraints constraints;
  final String? icon;

  const CommonEmptyPage(
      {super.key,
      required this.title,
      required this.tip,
      required this.constraints,
      this.icon});

  @override
  Widget build(BuildContext context) {
    return Container(
      height: constraints.maxHeight,
      alignment: Alignment.center,
      padding: EdgeInsets.symmetric(horizontal: 16.w),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.center,
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          Image.asset(
            icon ?? Res.common_empty_no_user,
            width: 120.w,
            fit: BoxFit.cover,
          ),
          20.h.sbh,
          Text(
            title,
            textAlign: TextAlign.center,
            style: lfTextStyle(sp: 18.sp, fontFamily: fontMedium),
          ),
          30.h.sbh,
          Text(
            tip,
            textAlign: TextAlign.center,
            style: lfTextStyle(
                sp: 16.sp, fontFamily: fontRegular, color: color514F62),
          ),
          40.h.sbh,
        ],
      ),
    );
  }
}
